#include <iostream>
#include <cmath>
#include "mode4.h"

class mode4::edge(float coff[][16][16], int m)
{
    float *temp = new float[][16][16];
    
    for(int i=0; i<16; i++)
       for(int j=0; j<16; j++)
       {
			temp[0][i][j] = coff[m][i][j];
			temp[1][i][j] = coff[m-16][i][j];
			temp[2][i][j] = coff[m-17][i][j];
			temp[3][i][j] = coff[m-1][i][j];
       }
    return temp;

    
    float *Eng_top = new float[3];
    float *Eng_left = new float[3];
    
    for(int n=0; n<4; n++)
		for(int i=0; i<16; i++)   
		   Eng_left[n] += abs(temp[n][i][0]);
    
    for(int n=0; n<4; n++)   
		for(int j=0; j<16; j++)
		   Eng_top[n] += abs(temp[n][0][j]);    
}

class mode4::dir4()
{
    float angle;
    float Eng = 0;
    
    for (int n=0; n<4; n++)
       Eng += Eng_top[n]/Eng_left[n];
       
    angle = atan(Eng/4);
    
    if((60<angle && angle<90) || (-90<angle && angle<-60))
       std::cout << "The mode is among: 0, 2, 5, 7" << std::endl;
    else if(-30<angle && angle <30)
       std::cout << "The mode is among: 1, 2, 6, 8" << std::endl;
    else 
       std::cout << "The mode is among: 0, 1, 2, 3" << std::endl;
}
       
       
       
       
       
       
       
       
       
       
       
    